# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-text-table
_gemname=text-table
pkgver=1.2.4
pkgrel=17
pkgdesc='Allows you to easily create and format plain text tables, useful when working with the terminal or when you want to quickly print formatted tables to a dot-matrix printer.'
arch=('any')
url='https://rubygems.org/gems/text-table'
license=('MIT')
depends=('ruby')
source=("https://rubygems.org/downloads/text-table-$pkgver.gem")
noextract=("text-table-$pkgver.gem")
options=(!emptydirs)
sha512sums=('9b31f0f0f5def462e403c85b3284005ae40c8a9ed6f16ff0767cda0cfbe35a8ad394d84bc5f520b8c98cd680c31d87f1a21343a4e9b5bcce9c5bfe382870b7f2')

package() {
  _gemdir="$(ruby -rubygems -e 'puts Gem.default_dir')"

  if [[ $CARCH == arm* ]] ; then
    gem install --no-user-install --ignore-dependencies --no-rdoc --no-ri \
      -i "$pkgdir$_gemdir" "$_gemname-$pkgver.gem"
  else
    gem install --ignore-dependencies --no-user-install -i "$pkgdir/$_gemdir" \
      -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"
  fi
}

